import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home'
import FreeCourse from '../views/FreeCourse'
import LiteCourse from '../views/LiteCourse'
import ActualCourse from '../views/ActualCourse'
import CourseDetail from '../views/CourseDetail'
import SearchCourse from "../views/SearchCourse";
import PaySucess from "../views/PaySucess";
Vue.use(VueRouter)  //使用VueRouter

const routes = [
    {
        path: '/',
        name: 'Home',
        component: Home
    },
    {
        path: '/home',
        name: 'Home',
        component: Home
    },
    {
        path: '/actual-course',
        name: 'ActualCourse',
        component: ActualCourse
    },
    {
        path: '/free-course',
        name: 'FreeCourse',
        component: FreeCourse
    },
    {
        path: '/light-course',
        name: 'LiteCourse',
        component: LiteCourse
    },
    {
        path: '/course/detail/:pk',
        name: 'CourseDetail',
        component: CourseDetail
    },
    {
        path: '/course/search',
        name: 'SearchCourse',
        component: SearchCourse,
    },
       {
        path: '/course/paysucess',
        name: 'PaySucess',
        component: PaySucess,
    }

]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
